﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using static NetCoreBBS.Common.Enums;

namespace NetCoreBBS.Entities
{
    public class Topic:BaseEntity
    {
        [Display(Name = "版块")]
        public int NodeId { get; set; }

        [Display(Name = "版块")]
        public TopicNode Node { get; set; }
        
        public int DepartmentId { get; set; }

        public string UserId { get; set; }

        public ApplicationUser User { get; set; }

        public string Email { get; set; }

        [Display(Name = "主题")]
        public string Title { get; set; }

        [Display(Name ="内容")]
        public string Content { get; set; }

        /// <summary>
        /// 置顶权重
        /// </summary>
        public int Top { get; set; }

        [Display(Name = "类型")]
        public TopicType Type { get; set; }

        [Display(Name = "查看次数")]
        public int ViewCount { get; set; }

        [Display(Name = "回复次数")]
        public int ReplyCount { get; set; }

        [Display(Name = "最后回复人")]
        public string LastReplyUserId { get; set; }

        [Display(Name = "最后回复人")]
        public ApplicationUser LastReplyUser { get; set; }

        [Display(Name = "最后回复时间")]
        public DateTime LastReplyTime { get; set; }

        [Display(Name = "创建时间")]
        public DateTime CreateTime { get; set; }

        public virtual List<TopicReply> Replys { get; set; }
    }

}
